﻿<UserControl x:Class="ToDoList.Views.QuickAddView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:SampleData="clr-namespace:ToDoList.SampleData"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:Behaviors="clr-namespace:ToDoList.Behaviors" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="700">
    
    <Grid x:Name="LayoutRoot" Background="{StaticResource DarkControlBackgroundBrush}"
          d:DataContext="{d:DesignInstance SampleData:DesignQuickAddViewModel, IsDesignTimeCreatable=True}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>       
        <TextBlock Text="Due Date:"/>
        <TextBox x:Name="DueDate"  VerticalAlignment="Center"                
            Text="{Binding DueDate,Mode=TwoWay,ValidatesOnNotifyDataErrors=True,NotifyOnValidationError=True}"
            Grid.Column="1">
            <i:Interaction.Behaviors>
                <Behaviors:TextBoxChangedBehavior/>
            </i:Interaction.Behaviors>
        </TextBox>
        <TextBlock Text="Title:" Grid.Column="2"/>
        <TextBox x:Name="Title" VerticalAlignment="Center"             
            Text="{Binding Title,Mode=TwoWay,ValidatesOnNotifyDataErrors=True,NotifyOnValidationError=True}"
            Grid.Column="3">
            <i:Interaction.Behaviors>
                <Behaviors:TextBoxChangedBehavior/>
            </i:Interaction.Behaviors>
        </TextBox>
        <Button x:Name="CommitCommand" Style="{StaticResource GreenButton}"
                HorizontalAlignment="Center" VerticalAlignment="Center"
            Content="Quick Add" Command="{Binding CommitCommand}"
                Grid.Column="4"/>
    </Grid>
</UserControl>
